﻿using MySchool;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinForm5
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void Form3_Load(object sender, EventArgs e)
        {
            DBHelper dBHelper = new DBHelper();
            DataSet ds = new DataSet();
            dBHelper.OpenConnection();
            this.dataGridView1.AutoGenerateColumns = false;
            // dataGridView 初始化
            string sql1 = "select * from sys_user";
            SqlDataAdapter adapter1 = new SqlDataAdapter(sql1, dBHelper.Connection);
            adapter1.Fill(ds, "sys_user");
            this.dataGridView1.DataSource = ds.Tables["sys_user"];
        }
    }
}
